package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum AcceptGroupInvite {
    REJECT("REJECT"), // 拒绝
    ACCEPT("ACCEPT"); // 接受

    private final String code;

    AcceptGroupInvite(String code){
        this.code = code;
    }

    public static AcceptGroupInvite byCode(String code) {
        for (AcceptGroupInvite e: AcceptGroupInvite.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }

    public static boolean isAccept(String code){
        return ACCEPT.code.equalsIgnoreCase(code);
    }

    public static boolean isReject(String code){
        return REJECT.code.equalsIgnoreCase(code);
    }
}
